package cn.teleus.common.util.i18n;

import org.springframework.beans.factory.support.BeanDefinitionBuilder;
import org.springframework.beans.factory.support.BeanDefinitionRegistry;
import org.springframework.context.annotation.ImportBeanDefinitionRegistrar;
import org.springframework.core.env.Environment;
import org.springframework.core.io.ResourceLoader;
import org.springframework.core.type.AnnotationMetadata;


/**
 * @author lengleng
 * @date 2018/7/24
 * 任务初配置入口类
 */
public class I18nAutoConfiguration implements ImportBeanDefinitionRegistrar {
	private ResourceLoader resourceLoader;
	private ClassLoader classLoader;
	private Environment environment;

	@Override
	public void registerBeanDefinitions(AnnotationMetadata annotationMetadata, BeanDefinitionRegistry beanDefinitionRegistry) {
		//手动注入 Forwards 类的实例
		BeanDefinitionBuilder i18nService_forwards = BeanDefinitionBuilder.rootBeanDefinition(I18nService.class);
		beanDefinitionRegistry.registerBeanDefinition("i18nService", i18nService_forwards.getBeanDefinition());
	}
}